﻿@model PessModel.Registration

@{
    ViewBag.Title = "Confirm Registration";
   
    PessModel.RegistrationOption BasicItem=null;
    PessModel.RegistrationOption AddonItem=null;
    if(Model!=null&&Model.RegistrationOptions.Count>0)
    {
         BasicItem=Model.RegistrationOptions.FirstOrDefault();
        AddonItem=Model.RegistrationOptions.Where(ro=>ro.Type==1).FirstOrDefault(); //1 is for optional items
    }

    PessMvc.Models.UserModel usermodel = ViewBag.UserInfo;
    
}

<h2>Confirm Registration</h2>

<div style="height:50px; margin-left:20px">
    1. Choose Registration Options - 2. Personal Information - <span style="font-weight:bold; font-size:larger">3. Confirm</span> - 4. Pay to complete
</div>

<fieldset class="show">
    <legend></legend>
    <div class="heading" style="margin-top:-15px;">
        Registration Information [@Html.ActionLink("Change","Register")]
    </div>

    <div class="display-label">
        Registered as: 
    </div>
    <div class="display-field">
        @if (BasicItem != null)
        {
            @BasicItem.Name @(DateTime.Now.Date<=BasicItem.EarlyDate?" - ¥" + BasicItem.EarlyFeeRMB.ToString("N")+" (Early bird)" :" -¥" + BasicItem.RegularFeeRMB.ToString("N")  )
        }
    </div>

    @if (AddonItem != null)
        {
            <div class="display-label">
                @AddonItem.Name<label>:</label>
            </div>
            <div class="display-field">
                     @(DateTime.Now.Date <= AddonItem.EarlyDate ? " ¥" + AddonItem.EarlyFeeRMB.ToString("N")  : " ¥" + AddonItem.RegularFeeRMB.ToString("N") )
            </div>
        }
    <div class="display-label">
        Preference:
    </div>
    <div class="display-field">
        @(Model.Preference==0?"Non-vegetarian":"Vegetarian")
    </div>

    <div class="display-label">
        Total:
    </div>
    <div class="display-field">
        ¥@Model.TotalAmountRMB.ToString("N")
    </div>

    <div class="heading" style="margin-top:15px;">
        Personal Information [@Html.ActionLink("Change", "ConfirmPersonalInformation")]
    </div>

    <div class="display-label">
        Email:
    </div>
    <div class="display-field">
        @usermodel.Email
    </div>

    <div class="display-label">
        Frist Name:
    </div>
    <div class="display-field">
        @usermodel.FirstName
    </div>

    <div class="display-label">
        Last Name:
    </div>
    <div class="display-field">
        @usermodel.LastName
    </div>

    <div class="display-label">
        Affiliation:
    </div>
    <div class="display-field">
        @usermodel.SchoolName
    </div>

    <div class="display-label">
        Professional Title:
    </div>
    <div class="display-field">
        @usermodel.ProfessionalTitle
    </div>

    <div class="display-label">
        Phone Number:
    </div>
    <div class="display-field">
        @usermodel.PhoneNumber
    </div>

    <div class="display-label">
        Fax:
    </div>
    <div class="display-field">
        @usermodel.Fax
    </div>

    <div class="display-label">
        Address:
    </div>
    <div class="display-field">
        @usermodel.Address1
        @(usermodel.Address2==""?"":", "+usermodel.Address2)
        @(usermodel.City == "" ? "" : ", " + usermodel.City)
        @(usermodel.StateProvince == "" ? "" : ", " + usermodel.StateProvince)
        @(usermodel.ZipCode == "" ? "" : ", " + usermodel.ZipCode)
    </div>

    <div class="display-label">
        Country:
    </div>
    <div class="display-field">
        @usermodel.Country
    </div>



</fieldset>

@using (Html.BeginForm())
{
     <input type="hidden" name="Amount" value="@Model.TotalAmountRMB" />   
     <div class="editor-btn" style="padding-left:250px">
            <input type="submit" value="Continue" />@(ViewBag.Msg!=null?"("+ViewBag.Msg+")":"")
        </div>
 }

